﻿$(document).ready(function () {
    $("button").click(function () {
        var selectedCity = $("#lsCities option:selected").val();
        $.post("/forecastweather/browse", { city: selectedCity },
            function (data) {
                // Successful requests get here
                // Update the page elements
                var html = "";

                for (var i = 0; i < data.length; i++) {
                    //$("div#forecastweather").append($("<div/>", { class: 'row', text: 'Title : ' + data[0].Title }))
                    html += "<div class = 'title'>Title : " + data[i].Title + "</div>";
                    html += "<div class = 'description'>Description : " + data[i].Description + "</div>";
                    html += "<div class = 'link'>Link : " + data[i].Link + "</div><br/>";
                    //html += "<div class = 'pubDate'>Date : " + data[i].Date + "</div>";
                }

                $("div#forecastweather").html(html);
            });
    });
});